#include"TrackProgression.h" 

#include"TrPrDefault.h"
#include"TrPrRandom.h"

TrackProgression::TrackProgression(QList< QPointer<Song> > *songs){
	m_songs = songs;
}

TrackProgression::~TrackProgression(){
	m_songs = 0;//Should not be deleted.
}

TrackProgression *TrackProgression::getTrackProgression(QList< QPointer<Song> > *songs, ProgressionType progression, RepeatType repeat){
	switch( progression ){
		case Default:
			return new TrPrDefault(songs, repeat);
		case Random:
			return new TrPrRandom(songs, repeat);
	}
	return 0;
}

const char *TrackProgression::progressionText()const{
	switch(progressionType()){
		case Default:
			return "Default";
		case Random:
			return "Random";
		default:
			return "Default";
	}
}

const char *TrackProgression::repeatText()const{
	switch(repeatType()){
		case NoRepeat:
			return "NoRepeat";
		case RepeatAll:
			return "RepeatAll";
		case RepeatOne:
			return "RepeatOne";
		default:
			return "NoRepeat";
	}
}
	